package com.youi.entity;

import java.util.Date;
import java.util.List;

import com.youi.common.DelStatus;

import java.io.Serializable;


/**
 * 用户订单信息
 * @author XJY
 */
public class Userorder implements Serializable {

	private Long id;							//ID
	private Date gmtCreated;					//创建时间
	private Integer delStatus;					//删除状态（0否 1是）
	private Date gmtModify;					    //最后修改时间
	private Long userId;					    //用户id
	private Long merchantId;					//商家id
	private Long activityId;					//活动id
	private Long leaderId;						//团长id
	private Integer orderType;					//订单类型(0直接下单 1拼团下单)
	private Integer status;					    //状态(-1已关闭 0待付款 1待发货 2待收货 3待评价 4已完成 5售后)
	private Integer merchantStatus;				//供应商提现状态(0不可提现 1未提现 2提现中 3提现成功 4提现失败)
	private Integer platformStatus;				//平台提现状态(0不可提现 1未提现 2提现中 3提现成功 4提现失败)
	private Integer refund;					    //退款(-2已拒绝 -1非售后 0申请中 1已处理 2已退款)
	private String orderNo;					    //订单号
	private String unioid;						//用户unioid
	private String userNo;					    //用户编码
	private String userName;				    //用户名称
	private String merchantCode;			    //商家编码
	private String merchantName;			    //商家名称
	private String deliveryType;			    //配送方式(多个逗号隔开)
	private Double amount;					    //订单总额
	private Double carriage;					//运费金额
	private Double discounts;					//优惠金额
	private Double couponAmount;			    //用券金额
	private Double payableAmount;			    //应付金额
	private Date gmtOrder;					    //下单时间
	private Date gmtPay;					    //付款时间
	private Date gmtDelivery;					//发货时间
	private Date gmtReceiving;					//收货时间
	private Date gmtComplete;					//完成时间
	private Date gmtRefund;					    //退款时间
	private Date gmtClose;					    //关闭时间
	private String mergeNo;					    //合并单号
	private Date gmtMerge;					    //合并时间
	private String remark;					    //买家留言
	private String consignee;				    //收货人
	private String phone;					    //收货电话
	private String province;				    //省
	private String city;					    //市
	private String district;				    //区
	private String address;					    //收货详细地址
	private String express;					    //快递公司
	private String expressCode;					//快递公司编码
	private String expressNo;				    //快递单号
	private Integer shipmentStatus;				//发货状态(0未发货 1已发货)
	private Date gmtShipment;					//快递发货时间
	private Date gmtUnfreeze;					//解冻时间
	private Date gmtMerchantWith;				//供应商提现时间
	private Date gmtPlatformWith;				//平台提现时间
	
	
	private List<Ordergoods> ordergoodsList;	//订单商品集合
	private Orderaftersale orderaftersale;		//订单售后信息
	private String topOrderNo;					//主订单号
	private Integer count;					    //订单商品集合的商品总数量
	private Double merchantRatio;			    //供应商分佣比例
	private Double merchantAmount;				//供应商分佣金额 
	private Double platformRatio;				//平台分佣比例
	private Double platformAmount;				//平台分佣金额
	private Double leaderRatio;					//团长分润比例
	private Double leaderAmount;				//团长分润金额
	private Double platformSum;					//平台分账总额(平台+团长-手续费)
	private Double serviceCharge;				//手续费
	
	
	public Userorder(){

    }

    public Userorder(Long id,Date gmtCreated,Integer delStatus,Date gmtModify) {
       this.id=id;
       this.gmtCreated=gmtCreated;
       this.delStatus=delStatus;
       this.gmtModify=gmtModify;
    }
    
    public Userorder(Long userId,Long merchantId,String userNo) {
        this.gmtCreated=new Date();
        this.delStatus=DelStatus.NODEL;
        this.gmtModify=gmtCreated;
        this.userId=userId;
        this.merchantId=merchantId;
        this.status=0;
        this.refund=-1;
        this.merchantStatus=0;
        this.platformStatus=0;
        this.userNo=userNo;
     }


    public Userorder(Long id,Date gmtCreated,Integer delStatus,Date gmtModify,Long userId,Long merchantId,Integer status,Integer refund,String orderNo,String userNo,String userName,String merchantCode,String merchantName,String deliveryType,Integer payType,String serialNumber,Double amount,Double carriage,Double discounts,Double couponAmount,Double payAmount,Date gmtOrder,Date gmtPay,Date gmtDelivery,Date gmtReceiving,Date gmtRefund,Date gmtClose,String mergeNo,Date gmtMerge,String remark,String consignee,String phone,String province,String city,String district,String address,String express,String expressNo,Integer shipmentStatus,Date gmtShipment) {
       this.id=id;
       this.gmtCreated=gmtCreated;
       this.delStatus=delStatus;
       this.gmtModify=gmtModify;
       this.userId=userId;
       this.merchantId=merchantId;
       this.status=status;
       this.refund=refund;
       this.orderNo=orderNo;
       this.userNo=userNo;
       this.userName=userName;
       this.merchantCode=merchantCode;
       this.merchantName=merchantName;
       this.deliveryType=deliveryType;
       this.amount=amount;
       this.carriage=carriage;
       this.discounts=discounts;
       this.couponAmount=couponAmount;
       this.gmtOrder=gmtOrder;
       this.gmtPay=gmtPay;
       this.gmtDelivery=gmtDelivery;
       this.gmtReceiving=gmtReceiving;
       this.gmtRefund=gmtRefund;
       this.gmtClose=gmtClose;
       this.mergeNo=mergeNo;
       this.gmtMerge=gmtMerge;
       this.remark=remark;
       this.consignee=consignee;
       this.phone=phone;
       this.province=province;
       this.city=city;
       this.district=district;
       this.address=address;
       this.express=express;
       this.expressNo=expressNo;
       this.shipmentStatus=shipmentStatus;
       this.gmtShipment=gmtShipment;
    }


	public void setId(Long id){
		this.id=id;
	}

	public Long getId(){
		return id;
	}

	public void setGmtCreated(Date gmtCreated){
		this.gmtCreated=gmtCreated;
	}

	public Date getGmtCreated(){
		return gmtCreated;
	}

	public void setDelStatus(Integer delStatus){
		this.delStatus=delStatus;
	}

	public Integer getDelStatus(){
		return delStatus;
	}

	public Long getLeaderId() {
		return leaderId;
	}

	public void setLeaderId(Long leaderId) {
		this.leaderId = leaderId;
	}

	public void setGmtModify(Date gmtModify){
		this.gmtModify=gmtModify;
	}

	public Date getGmtModify(){
		return gmtModify;
	}

	public void setUserId(Long userId){
		this.userId=userId;
	}

	public Long getUserId(){
		return userId;
	}

	public void setMerchantId(Long merchantId){
		this.merchantId=merchantId;
	}

	public Long getMerchantId(){
		return merchantId;
	}

	public void setStatus(Integer status){
		this.status=status;
	}

	public Integer getStatus(){
		return status;
	}

	public void setRefund(Integer refund){
		this.refund=refund;
	}

	public Integer getRefund(){
		return refund;
	}

	public void setOrderNo(String orderNo){
		this.orderNo=orderNo;
	}

	public String getOrderNo(){
		return orderNo;
	}

	public void setUserNo(String userNo){
		this.userNo=userNo;
	}

	public String getUserNo(){
		return userNo;
	}

	public void setUserName(String userName){
		this.userName=userName;
	}

	public String getUserName(){
		return userName;
	}

	public void setMerchantCode(String merchantCode){
		this.merchantCode=merchantCode;
	}

	public String getMerchantCode(){
		return merchantCode;
	}

	public void setMerchantName(String merchantName){
		this.merchantName=merchantName;
	}

	public String getMerchantName(){
		return merchantName;
	}

	public void setDeliveryType(String deliveryType){
		this.deliveryType=deliveryType;
	}

	public String getDeliveryType(){
		return deliveryType;
	}

	public void setAmount(Double amount){
		this.amount=amount;
	}

	public Double getAmount(){
		return amount;
	}

	public void setCarriage(Double carriage){
		this.carriage=carriage;
	}

	public Double getCarriage(){
		return carriage;
	}

	public void setDiscounts(Double discounts){
		this.discounts=discounts;
	}

	public Double getDiscounts(){
		return discounts;
	}

	public void setCouponAmount(Double couponAmount){
		this.couponAmount=couponAmount;
	}

	public Double getCouponAmount(){
		return couponAmount;
	}


	public void setGmtOrder(Date gmtOrder){
		this.gmtOrder=gmtOrder;
	}

	public Date getGmtOrder(){
		return gmtOrder;
	}

	public void setGmtPay(Date gmtPay){
		this.gmtPay=gmtPay;
	}

	public Date getGmtPay(){
		return gmtPay;
	}

	public void setGmtDelivery(Date gmtDelivery){
		this.gmtDelivery=gmtDelivery;
	}

	public Date getGmtDelivery(){
		return gmtDelivery;
	}

	public void setGmtReceiving(Date gmtReceiving){
		this.gmtReceiving=gmtReceiving;
	}

	public Date getGmtReceiving(){
		return gmtReceiving;
	}

	public void setGmtRefund(Date gmtRefund){
		this.gmtRefund=gmtRefund;
	}

	public Date getGmtRefund(){
		return gmtRefund;
	}

	public void setGmtClose(Date gmtClose){
		this.gmtClose=gmtClose;
	}

	public Date getGmtClose(){
		return gmtClose;
	}

	public void setMergeNo(String mergeNo){
		this.mergeNo=mergeNo;
	}

	public String getMergeNo(){
		return mergeNo;
	}

	public void setGmtMerge(Date gmtMerge){
		this.gmtMerge=gmtMerge;
	}

	public Date getGmtMerge(){
		return gmtMerge;
	}

	public void setRemark(String remark){
		this.remark=remark;
	}

	public String getRemark(){
		return remark;
	}

	public void setConsignee(String consignee){
		this.consignee=consignee;
	}

	public String getConsignee(){
		return consignee;
	}

	public void setPhone(String phone){
		this.phone=phone;
	}

	public String getPhone(){
		return phone;
	}

	public void setProvince(String province){
		this.province=province;
	}

	public String getProvince(){
		return province;
	}

	public void setCity(String city){
		this.city=city;
	}

	public String getCity(){
		return city;
	}

	public void setDistrict(String district){
		this.district=district;
	}

	public String getDistrict(){
		return district;
	}

	public void setAddress(String address){
		this.address=address;
	}

	public String getAddress(){
		return address;
	}

	public void setExpress(String express){
		this.express=express;
	}

	public String getExpress(){
		return express;
	}

	public void setExpressNo(String expressNo){
		this.expressNo=expressNo;
	}

	public String getExpressNo(){
		return expressNo;
	}

	public void setShipmentStatus(Integer shipmentStatus){
		this.shipmentStatus=shipmentStatus;
	}

	public Integer getShipmentStatus(){
		return shipmentStatus;
	}

	public void setGmtShipment(Date gmtShipment){
		this.gmtShipment=gmtShipment;
	}

	public Date getGmtShipment(){
		return gmtShipment;
	}

	public Long getActivityId() {
		return activityId;
	}

	public void setActivityId(Long activityId) {
		this.activityId = activityId;
	}

	public Integer getOrderType() {
		return orderType;
	}

	public void setOrderType(Integer orderType) {
		this.orderType = orderType;
	}

	public Integer getMerchantStatus() {
		return merchantStatus;
	}

	public void setMerchantStatus(Integer merchantStatus) {
		this.merchantStatus = merchantStatus;
	}

	public Integer getPlatformStatus() {
		return platformStatus;
	}

	public void setPlatformStatus(Integer platformStatus) {
		this.platformStatus = platformStatus;
	}

	public Double getPayableAmount() {
		return payableAmount;
	}

	public void setPayableAmount(Double payableAmount) {
		this.payableAmount = payableAmount;
	}

	public Date getGmtComplete() {
		return gmtComplete;
	}

	public void setGmtComplete(Date gmtComplete) {
		this.gmtComplete = gmtComplete;
	}

	public List<Ordergoods> getOrdergoodsList() {
		return ordergoodsList;
	}

	public void setOrdergoodsList(List<Ordergoods> ordergoodsList) {
		this.ordergoodsList = ordergoodsList;
	}

	public String getExpressCode() {
		return expressCode;
	}

	public void setExpressCode(String expressCode) {
		this.expressCode = expressCode;
	}

	public Orderaftersale getOrderaftersale() {
		return orderaftersale;
	}

	public void setOrderaftersale(Orderaftersale orderaftersale) {
		this.orderaftersale = orderaftersale;
	}

	public String getUnioid() {
		return unioid;
	}

	public void setUnioid(String unioid) {
		this.unioid = unioid;
	}

	public String getTopOrderNo() {
		return topOrderNo;
	}

	public void setTopOrderNo(String topOrderNo) {
		this.topOrderNo = topOrderNo;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public Date getGmtUnfreeze() {
		return gmtUnfreeze;
	}

	public void setGmtUnfreeze(Date gmtUnfreeze) {
		this.gmtUnfreeze = gmtUnfreeze;
	}

	public Date getGmtMerchantWith() {
		return gmtMerchantWith;
	}

	public void setGmtMerchantWith(Date gmtMerchantWith) {
		this.gmtMerchantWith = gmtMerchantWith;
	}

	public Date getGmtPlatformWith() {
		return gmtPlatformWith;
	}

	public void setGmtPlatformWith(Date gmtPlatformWith) {
		this.gmtPlatformWith = gmtPlatformWith;
	}

	public Double getMerchantRatio() {
		return merchantRatio;
	}

	public void setMerchantRatio(Double merchantRatio) {
		this.merchantRatio = merchantRatio;
	}

	public Double getMerchantAmount() {
		return merchantAmount;
	}

	public void setMerchantAmount(Double merchantAmount) {
		this.merchantAmount = merchantAmount;
	}

	public Double getPlatformRatio() {
		return platformRatio;
	}

	public void setPlatformRatio(Double platformRatio) {
		this.platformRatio = platformRatio;
	}

	public Double getPlatformAmount() {
		return platformAmount;
	}

	public void setPlatformAmount(Double platformAmount) {
		this.platformAmount = platformAmount;
	}

	public Double getLeaderRatio() {
		return leaderRatio;
	}

	public void setLeaderRatio(Double leaderRatio) {
		this.leaderRatio = leaderRatio;
	}

	public Double getLeaderAmount() {
		return leaderAmount;
	}

	public void setLeaderAmount(Double leaderAmount) {
		this.leaderAmount = leaderAmount;
	}

	public Double getPlatformSum() {
		return platformSum;
	}

	public void setPlatformSum(Double platformSum) {
		this.platformSum = platformSum;
	}

	public Double getServiceCharge() {
		return serviceCharge;
	}

	public void setServiceCharge(Double serviceCharge) {
		if (serviceCharge!=null) {
			this.serviceCharge = serviceCharge;
		}else {
			this.serviceCharge =0.00;
		}
	}
	
	
}
